﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SanFranciscoModel.Alumno;
using SanFranciscoModel.Curso;


namespace SanFrancisco
{
    public partial class ReporteAlumnosCursos : Form
    {
        public ReporteAlumnosCursos()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ReporteAlumnosCursos_Load(object sender, EventArgs e)
        {
            CargarAlumnos();
        }

        private void CargarAlumnos()
        {

            CursoDataContext Curso = new CursoDataContext();
            cmbCurso.DisplayMember = "NombreCurso";
            cmbCurso.ValueMember = "idCurso";
            cmbCurso.DataSource = Curso.CursosTodos();
        
        }

        private void cmbAlumnos_SelectedIndexChanged(object sender, EventArgs e)
        {
            AlumnoDataContext Alumno = new AlumnoDataContext();
            gridReporte.DataSource = Alumno.ReporteAlumnosCursos((int)cmbCurso.SelectedValue);
        }

    }
}
